#include <iostream>
#include <fstream>
#include <vector>
#include <sstream>
#include <string>

using namespace std;

typedef vector<vector<char>> Matrix;

struct InputTask
{
	int height;
	int width;
	int D;
	Matrix hall; 
};

typedef vector<InputTask> AllTasks;

AllTasks GetDataFromFile(string filename);

int main(void)
{
	// 1. Input data from file
	AllTasks all_tasks = GetDataFromFile("input.in");

	return 1;
}

AllTasks GetDataFromFile(string filename)
{
	AllTasks result;
	InputTask input;
	vector<char> line;
	char line_element = '\0';

	ifstream file(filename);
	int test_count = 0;
	file >> test_count;
	for (int i=0; i<test_count; i++)
	{
		file >> input.height >> input.width >> input.D;
		
		for (int j=0; j<input.height; j++)
		{
			for (int k=0; k<input.width; k++)
			{
				file >> line_element;
				line.push_back(line_element);
			}
			input.hall.push_back(line);
			line.clear();
		}

		result.push_back(input);
		input.hall.clear();
	}

	file.close();

	return result;
}